<link href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}" rel="stylesheet" type="text/css">
<div class="pageContent" id="poConfirmDetailGrid"></div>
<script type="text/javascript">
(function($){
	var $page = DWZ.context(), $grid = $('#poConfirmDetailGrid', $page), orderTypes = JSON.parse('<#noescape>${orderTypes}</#noescape>');
	orderTypes.unshift({orderTypeCode: '', orderTypeText: '<@label key="all.C">所有</@label>'});
	$grid.jGrid({
        layoutH: 165,
        width: 1750,
        base: hostUrl + '/confirmDetails/',
        url: 'queryDetailList',
        columns: [
            {field: '_index', text: '<@label key="serialNumber.C">序号</@label>', width: 40},
            {field: 'productionControlNum', text: '<@label key="productionControlNum.C">生产管理号</@label>', width: 120},
            {field: 'productionOrderNum', text: '<@label key="productionOrderNum.C">生产订单编号</@label>', width: 120},
            {field: 'materialCode', text: '<@label key="materialCode.C">物料编号</@label>', width: 100},
            {field: 'materialText', text: '<@label key="materialText.C">物料描述</@label>', width: 100},
            {field: 'quantity', text: '<@label key="quantity.C">数量</@label>', width: 60},
            {field: 'completedQuantity', text: '<@label key="completedQuantity.C">完工数量</@label>', width: 60},
            {field: 'scrappedQuantity', text: '<@label key="scrappedQuantity.C">报废数量</@label>', width: 60},
            {field: 'failureRate', text: '<@label key="defectiveRate.C">不良率</@label>', width: 60},
            {field: 'confirmUser', text: '<@label key="confirmUser.C">报工人</@label>', width: 100},
            {field: 'confirmDateTime', type: 'date', format: 'yyyy-MM-dd', defaultOrder: 'desc', text: '<@label key="confirmDateTime.C">报工日期</@label>', width: 80, orderTable: 'pc'},
            {field: 'workCenterText', text: '<@label key="workCenter.C">工作中心</@label>', width: 100},
            {field: 'workUnitText', text: '<@label key="workUnit.C">作业单元</@label>', width: 100},
            {field: 'processOperationId', text: '<@label key="processOperation.C">工艺路线</@label>', width: 80},
            {field: 'operationCode', text: '<@label key="operation.C">工序</@label>', width: 80},
            {field: 'orderTypeCode', text: '<@label key="orderTypeCode.C">订单类型编号</@label>', width: 100},
            {field: 'orderTypeText', text: '<@label key="orderTypeText.C">订单类型描述</@label>', width: 100},
            {field: 'customer', text: '<@label key="customer.C">客户</@label>', width: 100},
            {field: 'customerOrder', text: '<@label key="customerOrder.C">客户订单</@label>', width: 100},
            {field: 'priority', text: '<@label key="priority.C">优先级</@label>', width: 60}
        ],
        query: {
            queryfields: [
                {columnIndex: 1},
                {field: 'confirmDateStartTime', type: 'date', format: 'yyyy-MM-dd', dateGroup: 'confirmDate', css: 'from', text: '<@label key="confirmDateStartTime.C">报工日期从</@label>'},
                {field: 'confirmDateEndtTime', type: 'date', format: 'yyyy-MM-dd', dateGroup: 'confirmDate', css: 'to', text: '<@label key="EndtTime.C">到</@label>'},
                {columnIndex: 3, render: function($input) {
                	$input.attr({
                        lookupGroup: "materialLookup",
                		id: "materialLookup.materialCode",
                        postField: "materialCode",
                        suggestFields: "materialCode,materialText",
                        suggestUrl: "${rc.getContextPath()}/manage/material/componentSuggest"
                	});
                }},
                {field: 'workCenterCode', text: '<@label key="workCenter.C">工作中心</@label>', render: function($input) {
                	$input.attr({
                		lookupGroup: "workCenterGrp",
                		id: 'workCenterGrp.workCenterCode',
                		suggestFields: "workCenterCode,workCenterText", 
                		postField: "workCenterCode", 
                		suggestUrl: hostUrl + "/workCenter/workCenterSuggest"
                	});
                }},
                {columnIndex: 14, render: function($input) {
                	$input.attr({
                		lookupGroup: "workCenterGrp",
                		id: 'operationGrp.operationCode',
                		suggestFields: "operationCode,operationText", 
                		postField: "operationCode", 
                		suggestUrl: hostUrl + "/operation/operationSuggest"
                	});
                }},
            ],
            advancedqueryfields: [
				{columnIndex: 2},
                {field: 'orderTypeCode', text: '<@label key="orderType.C">订单类型</@label>', type: 'select', options: orderTypes, value: 'orderTypeCode', label: 'orderTypeText'},
				{columnIndex: 17},
				{columnIndex: 18},
				{columnIndex: 19, css: 'digits'}
			]
        },
        gridbars: [
            {icon: 'export', text: '<@label key="exportToExcel.D">导出EXCEL</@label>', title: "<@label key='confirmexportToExcel.M'>确定要导出这些记录吗?</@label>", 
                target: 'dwzExport', href: 'exportToExcel', data: {navTabId: '${navTabId!""}'}, menuCode: "export_confirm"}
        ]
    });
})(jQuery);
</script>